<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vueJS/vue.js"></script>
</head>

<body>
    <div id="app">
        <div>
            {{msg}}
        </div>
    </div>
</body>

</html>
<script type="text/javascript">
    var vm = new Vue({
        el: '#app',
        data: {
            msg: 'hi vue'
        },
        beforeCreate: function () {
            console.log("创建之前执行")
        },
        created: function () {
            console.log("创建之后执行")
        },
        beforeMount: function () {
            console.log("挂载之前执行");
        },
        mounted: function () {
            console.log("挂载完之后执行")
        },
        beforeUpdate: function () {
            console.log("更新前执行");
        },
        updated: function () {
            console.log("更新后执行")
        },
        beforeDestroy: function () {
            console.log("销毁之前执行");
        },
        destroyed: function () {
            console.log("销毁后执行");
        }
    })

    setTimeout(function () {
        this.vm.msg = '值修改'
    },3000)

</script>